package com.wisdom.view.adapter;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.bluecall.sipua.R;

public class HomeSettingAdapter extends BaseAdapter {
    
	private LayoutInflater inflater;
	private Context context;
	public static final List<String> more_list=new ArrayList<String>();//为条目提供数据
	public HomeSettingAdapter(Context context){
		this.context=context;
		inflater=LayoutInflater.from(this.context);
		if(more_list.size()<1){
		more_list.add(context.getResources().getString(R.string.main_square));
		more_list.add(context.getResources().getString(R.string.setting_pay));
	  more_list.add(context.getResources().getString(R.string.share));
	  more_list.add(context.getResources().getString(R.string.callsetting));
	  more_list.add(context.getResources().getString(R.string.help_text));
	  more_list.add(context.getResources().getString(R.string.advice));
	  more_list.add(context.getResources().getString(R.string.exit_title));
	  more_list.add("sip账号设置");
	  more_list.add(context.getResources().getString(R.string.makecallback));
	  //more_list.add(context.getResources().getString(R.string.debugactivity));
		}
	}
	@Override
	public int getCount() {
		return more_list.size();  //条目数量
	}
	@Override
	public Object getItem(int position) {
		return null;
	}
	@Override
	public long getItemId(int position) {
		return 0;
	}
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if(convertView==null){
			convertView=inflater.inflate(R.layout.more_list,null);
		   
		}
		ImageView icon=(ImageView)convertView.findViewById(R.id.item_icon);//设置每个条目的图标
		if(0 == position){
			  icon.setBackgroundResource(android.R.drawable.ic_menu_info_details); 
		  }else if(1 == position){
			  icon.setBackgroundResource(R.drawable.ic_tab_money_pressed);
		  }else if(2 == position){
			  icon.setBackgroundResource(android.R.drawable.ic_menu_share);
		  }else if(3 == position){
			  icon.setBackgroundResource(R.drawable.set_dial_setting);
		  }else  if(4==position){
			 icon.setBackgroundResource(android.R.drawable.ic_menu_help);  
		  }
		  else if(5==position){
			  
		  }
		  	else if(6==position){
		  		icon.setBackgroundResource(android.R.drawable.ic_menu_close_clear_cancel);
		  }
		
		  TextView text = (TextView) convertView.findViewById(R.id.more_item_text); //设置条目的文字说明
		  text.setText(more_list.get(position));
		  return convertView;
	}

}
